﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.Platform.Migrations
{
    /// <inheritdoc />
    public partial class add_table_StdDomainDict_1 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_StdPhrDict_StdDomainDict_StdDomainDictId",
                table: "StdPhrDict");

            migrationBuilder.DropPrimaryKey(
                name: "PK_StdDomainDict",
                table: "StdDomainDict");

            migrationBuilder.RenameTable(
                name: "StdDomainDict",
                newName: "MainStdDomainDict");

            migrationBuilder.AddPrimaryKey(
                name: "PK_MainStdDomainDict",
                table: "MainStdDomainDict",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_StdPhrDict_MainStdDomainDict_StdDomainDictId",
                table: "StdPhrDict",
                column: "StdDomainDictId",
                principalTable: "MainStdDomainDict",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_StdPhrDict_MainStdDomainDict_StdDomainDictId",
                table: "StdPhrDict");

            migrationBuilder.DropPrimaryKey(
                name: "PK_MainStdDomainDict",
                table: "MainStdDomainDict");

            migrationBuilder.RenameTable(
                name: "MainStdDomainDict",
                newName: "StdDomainDict");

            migrationBuilder.AddPrimaryKey(
                name: "PK_StdDomainDict",
                table: "StdDomainDict",
                column: "Id");

            migrationBuilder.AddForeignKey(
                name: "FK_StdPhrDict_StdDomainDict_StdDomainDictId",
                table: "StdPhrDict",
                column: "StdDomainDictId",
                principalTable: "StdDomainDict",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }
    }
}
